package cn.sciento.farm.devicemanager.service.impl;

import cn.sciento.farm.devicemanager.dao.entity.DevAlarmPersonRel;
import cn.sciento.farm.devicemanager.dao.mapper.DevAlarmPersonRelMapper;
import cn.sciento.farm.devicemanager.service.AlarmPersonRelService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author walton
 * @description
 * @date 2020/11/25 10:11
 */
@Service
public class AlarmPersonRelServiceImpl implements AlarmPersonRelService {

    @Autowired
    private DevAlarmPersonRelMapper devAlarmPersonRelMapper;

    @Override
    public List<DevAlarmPersonRel> getByPersonId(Long personId) {
        QueryWrapper<DevAlarmPersonRel> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("person_id", personId);
        return devAlarmPersonRelMapper.selectList(queryWrapper);
    }
}
